Skip to main content

stringToColor

Type​

handler

Summary​

Converts a string to a color

Syntax​

stringToColor(<pString>)

Description​

Use the stringToColor handler when receiving colors from LiveCode script via a property setter, or from the widget's stored properties array when loading.

Parameters​

NameTypeDescription

pString

A comma delimited string representing a color in RGB / RGBA format

Examples​

property widgetColor 	get getColor	set setColor
metadata widgetColor.editor is "com.livecode.pi.colorwithalpha"

private variable mColor as Color

public handler OnLoad(in pProperties as Array)
setColor(pProperties["color"])
end handler

public handler setColor(in pColor as String)
put stringToColor(pColor) into mColor
redraw all
end handler